import requests
from init.celery import celery


# celery使用方式2：定时任务
# @celery.task(name="celery_related.sche_tasks.crwal_info", ignore_result=False)
@celery.task
def crwal_info():
    print("延迟5s执行百度爬取任务....")
    url = "http://www.baidu.com"
    response = requests.get(url).status_code
    print(response)
    print("百度爬取任务执行完毕...")
